<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/pageload.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tool.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/nprogress.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/iframeResizer.contentWindow.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_multiple.js"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				banpageKey();
				$("[placeholder]").tooltip();
				$('input[type=checkbox],input[type=radio]').espcms_checkbox();
				$("#espcms_saveInfo").espcms_formvalidation();
				[%if $type=='del' && @this->power('delDatabase')%]
				$('#espcms_saveInfo').ajaxForm({
					type: 'POST',
					url: '[%$link.del%]',
					dataType: 'json',
					beforeSubmit: function () {
						parent.espcms_are_loading();
					},
					success: function (data) {
						parent.$("#espcms_are_loading").dialog("close");
						parent.$("body").append(data.data);
						if (data.code === 'true') {
							parent.$.espcms_sticky(data.message, {'autoclose': 3000});
							parent.frames['[%$par_iframes_name%]'].refresh('ajax_list');
							parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
						} else {
							var botton = [
								{
									text: "[%pack:botton_pack-espcms_botton_colse%]",
									class: "btn btn-lightgray",
									click: function () {
										parent.$(this).dialog("close");
										parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
									}
								}
							];
							parent.espcms_public_dialog(data.domid_name, botton, 600);
						}
						$(window).unbind('beforeunload');
					}
				});
				[%/if%]
				[%if $type=='recover' && @this->power('optimizeDatabase')%]
				$('#espcms_saveInfo').ajaxForm({
					type: 'POST',
					url: '[%$link.save%]',
					dataType: 'json',
					beforeSubmit: function () {
						parent.espcms_are_loading();
					},
					success: function (data) {
						parent.$("#espcms_are_loading").dialog("close");
						parent.$("body").append(data.data);
						if (data.code === 'true') {
							parent.$.espcms_sticky(data.message, {'autoclose': 3000});
							parent.frames['[%$par_iframes_name%]'].refresh('ajax_list');
							parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
						} else {
							var botton = [
								{
									text: "[%pack:botton_pack-espcms_botton_colse%]",
									class: "btn btn-lightgray",
									click: function () {
										parent.$(this).dialog("close");
										parent.$(this).espcms_window_tab('close', {'iframeName': '[%$iframes_name%]'});
									}
								}
							];
							parent.espcms_public_dialog(data.domid_name, botton, 600);
						}
						$(window).unbind('beforeunload');
					}
				});
				[%/if%]
				$('.espcms_save_cancel').espcms_window_tab('closeTab');

				$('.selecticon').unbind('click').bind('click', function () {
					var file_name = $(this).attr('data-id');
					$(this).find('input').espcms_checkbox('check');
					$('#recover_file').val(file_name);
				});

				$('.select_id').on('ifClicked', function () {
					var file_name = $(this).val();
					$('#recover_file').val(file_name);
				});

			});
		</script>
	</head>

	<body class="espcms_style_all">
		<div class="main">
			<div class="espcms_center_content_list">

				<div class="panel">
					<div class="panel-body form_bottom_page">
						<form class="form-horizontal admin-form" id="espcms_saveInfo" action="[%$link.save%]">
							<input type="hidden" name="token_key" id="token_key" value="[%$token.token_key%]"/>
							<input type="hidden" name="token_name" id="token_name" value="[%$token.token_name%]"/>
							<input type="hidden" name="savetype" value="recover"/>
							<input type="hidden" name="recover_file" id="recover_file" validation="true" data-validation-botton="recover_file_select" data-validation="^[\w]+$" data-validation-msg="[%pack:database_pack-espcms_lable_database_recover_select_err%]"/>
							[%if $type=='del'%]
							<div class="section-divider mb40"><span>[%pack:database_pack-espcms_lable_database_del_botton%]</span></div>
							[%else%]
							<div class="section-divider mb40"><span>[%pack:database_pack-espcms_lable_database_recover_botton%]</span></div>
							[%/if%]
							<div class="form-group">
								<label class="col-sm-2 control-label pt10">[%pack:database_pack-espcms_lable_database_bak_filelist%]</label>
								<div class="col-sm-9">
									<div class="form_itme_list">
										<table class="form_itme_table">
											<thead>
												<tr>
													<th class="text-center table_width_60">[%pack:public_pack-espcms_lable_select_name%]</th>
													<th class="text-center">[%pack:database_pack-espcms_lable_database_recover_filename%]</th>
													<th class="text-center">[%pack:database_pack-espcms_lable_database_recover_baknum%]</th>
													<th class="text-center end">[%pack:database_pack-espcms_lable_database_recover_addtime%]</th>
												</tr>
											</thead>
											<tbody id="recover_file_select">
												[%if count($sqlbak_info)>0%]
												[%forlist from=$sqlbak_info key=i%]
												<tr data-id="[%$sqlbak_info[i].filename%]" class="selecticon m-cp">
													[%if $type=='del'%]
													<td class="text-center m-cp"><input type="checkbox" name="select_id[]" class="select_id" value="[%$sqlbak_info[i].filename%]"/></td>
													[%else%]
													<td class="text-center m-cp"><input type="radio" name="select_id" class="select_id" value="[%$sqlbak_info[i].filename%]"/></td>
													[%/if%]
													<td class="text-center f12 m-cp">[%$sqlbak_info[i].filename%]</td>
													<td class="text-center f12 m-cp">[%$sqlbak_info[i].baknum%]</td>
													<td class="text-center f12 m-cp">[%$sqlbak_info[i].addtime|espcms_timeformat(3)%]</td>
												</tr>
												[%/forlist%]
												[%else%]
												<tr class="selecticon">
													<td class="text-center bort0" colspan="7">[%pack:database_pack-espcms_lable_database_nobakfile%]</td>
												</tr>
												[%/if%]
											</tbody>
										</table>
									</div>
								</div>
							</div>
							[%if $type=='del'%]
							<div class="form_button">
								<button type="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_del_ok%]</button>
								<button type="button" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_del_no%]</button>
							</div>
							[%else%]
							<div class="form_button">
								<button type="submit" class="btn btn-green min-w-150" formmethod="POST">[%pack:botton_pack-espcms_botton_recover_ok%]</button>
								<button type="button" class="btn btn-lightgray min-w-150 espcms_save_cancel">[%pack:botton_pack-espcms_botton_recover_cancel%]</button>
							</div>
							[%/if%]
						</form>
					</div>
				</div>

			</div>
		</div>
		[%link file="public/load.html"%]
		[%link file="public/load_height.html"%]
	</body>
</html>
